{include file="admin/site_header.tpl"}
{include file="admin/dashboard/navi.tpl"}
{$i = $data.row}

<div id="container">
	<div class="inner-container">

		<div class="box box-100 greenbox">
			<div class="boxin">
				<div class="header">
					<h3>ID : {$i.contentID} - {$i.title}</h3>
				</div>
				<div class="content" >
					<div class="quick-link">

		<!-- form -->			
		<style>
			label { display:inline-block;width:140px;padding:5px 0 5px 20px; }
		</style>			

		<form id="form_berita" class="form columns" action="{$site.site}adminajax/contentUpdate/" method="POST" enctype="multipart/form-data">

			<input type="hidden" id="contentID" 	name="contentID"  	 value="{$i.contentID}"/>
			<input type="hidden" id="order" name="order" value="{$data.order}"/>
			<input type="hidden" id="sort" 	name="sort"  value="{$data.sort}"/>
			<input type="hidden" id="page" 	name="page"  value="{$data.page}"/>
			<input type="hidden" id="limit" name="limit" value="{$data.limit}"/>
			
			<label><b><span id="alert">{$data.msg}</span></b></label><br />
			<label>Judul: </label>
				<input type="text" class="inputtext mandatory" id="title" name="title" value='{$i.title}' style="width:550px;"/> <br />

			<label>Terbitkan: </label>
			
				<input type="radio" id="state" name="state" value="0" {$i.isUnPublish} /> Tidak
				<input type="radio" id="state" name="state" value="1" {$i.isPublish} /> Ya <br />
			
			<label style="vertical-align: top;">Isi Berita: </label>
				<textarea id="fulltext" name="fulltext" class="mandatory" cols="67" rows="11">{$i.fulltext}</textarea><br /><br />
			
			<label>Fitur: </label>
				<input type="checkbox" id="slideshow" name="slideshow"  value="1" {$i.isSlideshow} /> Slideshow 
				<input type="checkbox" id="headline" name="headline"  value="1" {$i.isHeadline} /> Headline <br />			 

				<label>Foto Utama :</label>
				<input type="file" id="img_1" name="img_1"  class="inputtext" style="width:200px;"/>
				<br style="height:5px;line-height:5px;"><br style="height:5px;line-height:5px;">
				{if strlen($i.img_1) > 0}
				{$i.img_1}<br/>
				<img src='{$site.site}{$i.img_1}' alt='Foto Utama' style="max-width:150px;" /> <br /><br />
				{/if}
				
			<label>Foto Tambahan  1:</label>
				<input type="file" id="img_2" name="img_2"  class="inputtext" style="width:200px;"/>
				<br style="height:5px;line-height:5px;"><br style="height:5px;line-height:5px;">
				{if strlen($i.img_2) > 0}
					{$i.img_2}<br/>
					<img src='{$site.site}{$i.img_2}' alt='Foto Utama' style="max-width:150px;" /><br /><br /><br /><br />
				{/if}				
			<label >Foto Tambahan 2:</label>
				<input type="file" id="img_3" name="img_3"  class="inputtext" style="width:200px;"/>
				<br style="height:5px;line-height:5px;"><br style="height:5px;line-height:5px;">
				{if strlen($i.img_3) > 0}
				{$i.img_3}<br/>
					<img src='{$site.site}{$i.img_3}' alt='Foto Utama' style="max-width:150px;" /><br /><br /><br /><br />
				{/if}

				<label style="margin-left:165px; padding:0; width:80px;">
			<button id="btnsave" value="save" class="button altbutton" type="submit"/>Submit</button>
			</label>
			<label style="margin-left:5px; padding:0; width:80px;">
			<button id="back" value="back" class="button altbutton" type="button"/>Back</button>
			</label>
		</form>
		<!-- end form -->
	
			</div><!-- .quick-link -->
		</div><!-- .content -->
	</div>
</div>

<script type="text/javascript">
$(document).ready(function(){
	$('#back').click( function (e) {
		top.location.href = "{$data.back}";
	});
	
	/*
	$('#btnsave', $('#form_berita')).live( 'click', function() {
		var _post = [{ name:'ts', value:new Date().getTime() }], _err  = 0;
			_count= 1;

		$('input,textarea', $('#form_berita')).each(function () {
			var _val = $(this).val();
			_post.push({ name:this.id, value:_val });
		});
		
		alert(_post.toSource());
		$.post('{$site.site}adminajax/contentUpdate/', _post, function(response) {
			$('#alert').html(response);
		});
	});
	*/
});
</script>

{include file="admin/site_footer.tpl"}